
        function show_save_express(category, id){
             $('#save_express').modal('show');
             $("#save_express_btn").html("保存")
             $("#express_num").val('');
             $("#save_express_btn").attr("onclick", "save_express("+category+","+id+")");
        }

        function save_express(category, id){
             var express_company = $("#express_company").val();
             var express_num = $("#express_num").val();
             if (express_company=="0"){
                   alert("请选择快递公司");
                   return false;
              }
             if ($.trim(express_num)==""){
                    alert("请输入快递单号");
                    return false;
             }
             $("#save_express_btn").html("正在保存")
            if (category == 1){
                  Dajaxice.wisezone.ebusiness.goods.save_express(save_expressCallback, {'pid':id, 'express_company':express_company, 'express_number':express_num});
            }else{
                  Dajaxice.jianfa.farm.save_express(save_expressCallback, {'recipe_id':id, 'express_company':express_company, 'express_number':express_num});
            }
        }

        function save_expressCallback(ret){
             $('#save_express').modal('hide');
            if(ret.retcode==1){
                if(ret.category==1){
                    $("#1deliver_btn_"+ret.id).html('已发货');
                }else{
                    $("#2deliver_btn_"+ret.recipe_id).html('已发货');
                }
            }else{
                alert("保存失败，请稍后再试。")
            }
        }

        function close_save_express(){
             $('#save_express').modal('hide');
        }



        var show_express_number;
        function show_express_info(express, id){
            var express_company = $(express).attr('express_company');
            var express_company_name = $(express).attr('express_company_name');
            var express_number = $(express).attr('express_number');
            show_express_number = express_number;
            if(express_company_name==''||express_number==''){
                alert('物流信息不完整，无法查询。')
                return false;
            }
            $('#express_info').find('.info_list').html('');
            $('#express_info').find('.info_list').hide();
            $('#express_info').find('.loading').show();
            Dajaxice.wisezone.ebusiness.express.get_express_info(get_express_infoCallback, {'express_company_name':express_company_name, 'express_number':express_number, 'category':2, 'query_id':id});

            $('#express_info').modal('show');
         }

        function get_express_infoCallback(ret){
            $('#express_info').find('.loading').hide();
            if (show_express_number == ret.express_number){
                if(ret.retcode==1){
                    var info_list = "<p style='float:left; font-size:12px; color:#404040; font-weight:bold; margin-right:40px;'>" + ret.express_company_name+"</p><p style='float:left; font-size:12px; color:#404040; font-weight:bold;'>单号："+ret.express_number+"</p><div class='clear'></div>";
                    for (var i=0;i<ret.path.length;i++){
                        info_list += "<p style='font-size:12px; color:#404040'><span style='display:block; width:130px; float:left'>" + ret.path[i].time +"</span> <span style='float:left; width:350px; display:block;'>" + ret.path[i].info + "</span></p>"
                    }
                    info_list += "<div class='clear'></div>"
                    $('#express_info').find('.info_list').html(info_list);
                    $('#express_info').find('.info_list').show();
                }else{
                    $('#express_info').find('.info_list').html('<p>查询失败，请稍后再试。</p>');
                    $('#express_info').find('.info_list').show();
                }
            }
        }

        function close_express_info(){
             $('#express_info').modal('hide');
        }
